]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Return all parameters on sprite content preferred size
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 11 Mar 2019 20:36:55 +0000 (20:36 +0000)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 1 Apr 2019 20:13:50 +0000 (22:13 +0200)
ClutterContent's get_preferred_size should return a boolean weather the
preferred size is valid, so in javascript we've to return this state value
before out width and height.

Since this was not happening, clutter was considering the width as the state
(converting the non-zero value to true), the height as the width, while ignoring
the returned height (that was then defaulted to 0)

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1020

js/ui/magnifier.js

index ba7227d67df206fd67f3b5b8e501ddc44ec0e026..4a21b71e5c14563a19f1b0f92935ac41b554ffe2 100644 (file)
@@ -56,9 +56,9 @@ var MouseSpriteContent = GObject.registerClass({
 
     vfunc_get_preferred_size() {
         if (!this._texture)
-            return [0, 0];
+            return [false, 0, 0];
 
-        return [this._texture.get_width(), this._texture.get_height()];
+        return [true, this._texture.get_width(), this._texture.get_height()];
     }
 
     vfunc_paint_content(actor, node) {